#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "heads.h"
#include "dialog.h"
#include "dataread.h"
#include <QInputDialog>
#include <QTimer>
#include "data.h"
#include <QMouseEvent>
#include <QEvent>
#include <QMenu>
#include <QAction>
#include <QCursor>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

public slots:
    void initDeltaZMaxSlot(QVector<double> vec);
    void on_btnBegin_clicked();
    void updateDeltaZSlot(QVector<double> vec);
private slots:
    void on_btn14_clicked();

    void on_btn13_clicked();

    void on_btn12_clicked();

    void on_btn11_clicked();

    void on_btn10_clicked();

    void on_btn9_clicked();

    void on_btn8_clicked();

    void on_btn7_clicked();

    void on_btn6_clicked();

    void on_btn5_clicked();

    void on_btn4_clicked();

    void on_btn3_clicked();

    void on_btn2_clicked();

    void on_btn1_clicked();

    void updateWarnSlot(int index, bool iswarn);
protected:
    virtual bool eventFilter(QObject* watch, QEvent* event);
private:
    Ui::Widget *ui;
    Dialog initDialog;
    DATAREAD dataread;
    QTimer t;
    showdata d6;
    showdata d7;
    showdata d8;
    showdata d9;
    showdata d10;
    showdata d11;
    showdata d12;
    showdata d13;
    showdata d14;

    void setDeltaZMax(int index);
    int timeMs;

    QMenu* popMenu6;
    QAction* unWarn6;
    QAction* setMax6;

    QMenu* popMenu7;
    QAction* unWarn7;
    QAction* setMax7;

    QMenu* popMenu8;
    QAction* unWarn8;
    QAction* setMax8;

    QMenu* popMenu9;
    QAction* unWarn9;
    QAction* setMax9;

    QMenu* popMenu10;
    QAction* unWarn10;
    QAction* setMax10;

    QMenu* popMenu11;
    QAction* unWarn11;
    QAction* setMax11;

    QMenu* popMenu12;
    QAction* unWarn12;
    QAction* setMax12;

    QMenu* popMenu13;
    QAction*unWarn13;
    QAction* setMax13;

    QMenu* popMenu14;
    QAction* unWarn14;
    QAction* setMax14;

    void menuInit();
private slots:
    void setMs();
//    void updataTable();
//    void tableClear(int nb);
//    void tableInit();
//    void on_btnFresh_clicked();
    void setDeltaZ6();
    void SetUnwarn6();
    void setDeltaZ7();
    void SetUnwarn7();
    void setDeltaZ8();
    void SetUnwarn8();
    void setDeltaZ9();
    void SetUnwarn9();
    void setDeltaZ10();
    void SetUnwarn10();
    void setDeltaZ11();
    void SetUnwarn11();
    void setDeltaZ12();
    void SetUnwarn12();
    void setDeltaZ13();
    void SetUnwarn13();
    void setDeltaZ14();
    void SetUnwarn14();
};
#endif // WIDGET_H

//SAAV_480373_20_500.dat
